import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import isAuthDirective from '@/utils/permission'

import * as ElIconModules from '@element-plus/icons-vue'

const app = createApp(App)

for (const iconName in ElIconModules) {
  if (Reflect.has(ElIconModules, iconName)) {
    const item = ElIconModules[iconName]
    app.component(iconName, item)
  }
}

app.use(createPinia())
app.use(router)
app.use(isAuthDirective)

import tableHeaderCellStyle from '@/utils/style.js'

app.config.globalProperties.tableHeaderStyle = tableHeaderCellStyle

app.mount('#app')
